<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">

        <blockquote class="layui-elem-quote layui-text">
            在这里进行的设置会影响到所有相册的上传
        </blockquote>
        <form class="layui-form" action="">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>基础设置</legend>
            </fieldset>


            <div class="layui-form-item">
                <label class="layui-form-label">允许学生上传照片</label>
                <div class="layui-input-block">
                    <input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest"
                           lay-text="是|否">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">允许辅导员修改学生照片</label>
                <div class="layui-input-block">
                    <input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest"
                           lay-text="是|否">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">允许学生公开相册</label>
                <div class="layui-input-block">
                    <input type="checkbox" checked="" name="open" lay-skin="switch" lay-filter="switchTest"
                           lay-text="是|否">
                </div>
            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend>基础设置</legend>
            </fieldset>
            <div class="layui-form-item">
                <label class="layui-form-label">图片长度和宽度限制</label>
                <div class="layui-input-block layui-inline" style="width: 20%;margin-left: unset">
                    <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入长度(像素)"
                           class="layui-input">
                </div>
                <div class="layui-input-block layui-inline" style="width: 20%;margin-left: unset">
                    <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入宽度(像素)"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">图片大小限制</label>
                <div class="layui-input-block layui-inline" style="width: 20%;margin-left: unset">
                    <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入大小(MB)"
                           class="layui-input">
                </div>
            </div>
            <center>
                <button class="layui-btn" lay-submit="" lay-filter="demo2" style="margin: 0 auto">保存</button>
            </center>
        </form>

    </div>
</div>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //自定义验证规则
        form.verify({

        });

        //监听指定开关
        form.on('switch(switchTest)', function (data) {
            layer.msg('开关checked：' + (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：待定 ', data.othis)
        });

        //监听提交
        form.on('submit(demo1)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });
    });
</script>